package models;

import java.util.LinkedList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import play.db.jpa.Model;

@Entity
@Table(name = "Effort_Units")
public class EffortUnit extends Model {

	public String unit; 

	public boolean isSystem;

	@OneToMany(mappedBy = "unit", cascade = { CascadeType.REMOVE })
	public List<EffortUnitProject> projectUnits = new LinkedList<EffortUnitProject>();

	/**
	 * constructs an effortUnit
	 * 
	 * @param project
	 * @param unit
	 */
	public EffortUnit(boolean isSystem, String unit) {
		this.isSystem = isSystem;
		this.unit = unit;
	}

}
